﻿using liaowa2.Entity.DTO.Article;
using liaowa2.Interface.Manager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace liaowa2.Web.Controllers
{
    public class ArticleController : BaseController
    {
        IArticleInterface articleInterface;
        public ArticleController(IArticleInterface articleInterface)
        {
            this.articleInterface = articleInterface;
        }
        // GET: Article
        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult List(ListInputDTO inputDTO)
        {
            var output = this.articleInterface.List(inputDTO);
            return Json(output);
        }

        [HttpPost]
        public ActionResult Delete(int id)
        {
            var output = this.articleInterface.Delete(id);
            return Json(output);
        }

        [HttpPost]
        public ActionResult Off(int id)
        {
            var output = this.articleInterface.Off(id);
            return Json(output);
        }
    }
}